import React, {Component} from 'react';

import './index.less';

import language from '../../language';

const TableRowOperator = (props) => {
    const {
        tableId, 
        index,
        copyRow,
        cardTable: {
            getRowsByIndexs
        },
        deleteRow,
        pasteRow,
        addRow,
        insertRow
    } = props;

    return (
        <div className="table-row-operator-wrapper">
            <a 
                href="javascript:void(0);" 
                className="table-operator-btn"
                onClick={() => {
                    deleteRow(tableId, [index]);
                }}
            >
                {language['hi6007-000031']}{/* 国际化处理： 删除*/}
            </a>
            <a 
                href="javascript:void(0);" 
                className="table-operator-btn"
                onClick={() => {
                    let data = getRowsByIndexs(tableId, [index]);
                    copyRow(tableId, data);
                }}
            >
                {language['hi6007-000054']}{/* 国际化处理： 复制*/}
            </a>
            <a 
                href="javascript:void(0);" 
                className="table-operator-btn"
                onClick={() => {
                    pasteRow(tableId, index);
                }}
            >
                {language['hi6007-000055']}{/* 国际化处理： 粘贴*/}
            </a>
            <a 
                href="javascript:void(0);" 
                className="table-operator-btn"
                onClick={() => {
                    insertRow(tableId, index);
                }}
            >
                {language['hi6007-000056']}{/* 国际化处理： 插入*/}
            </a>
        </div>
    );
}

export default TableRowOperator;
